#ifndef SWANLINK_FINANCE_MAKECARD_SERVICES_ADAPTOR_SEAORY_INCLUDE_SEAORY_ADAPTOR_H
#define SWANLINK_FINANCE_MAKECARD_SERVICES_ADAPTOR_SEAORY_INCLUDE_SEAORY_ADAPTOR_H
#include <string>
#include <securec.h>
#include "makecard_bitmap.h"
#include "imakecard_adaptor.h"
#include "SeaoryPrinter.h"
#include "makecard_def.h"
#include "makecard_common.h"
#include "plugin.h"

namespace SwanLink {
namespace Finance {
class IMakeCardSeaoryAdaptor : public IMakeCardAdaptor {
 public:
    IMakeCardSeaoryAdaptor();
    virtual ~IMakeCardSeaoryAdaptor();
    int Open(const Transport &tran) override;
    int Close() override;
    bool IsOpen() override;
    int Reset() override;
    int GetStatus(int module, char *err) override;
    int GetStatus();  // 用于再执行控制操作前判断设备状态
    /**
     * 设置打印机配置
     */
    int SetConfig(int configType, int configValue) override;
    /**
     * 设置standby参数
     */
    int SetStandbyParam(int dir, int pos, int standbyTime) override;
    /**
     * 打印卡片
     */
    int PrintCard(BmpInfo cardBmpInfo) override;
    /**
     * 获取打印机信息
     */
    int GetDeviceInfo(int infoType, char *infoValue) override;
    /**
     * 获取错误信息
     */
    void GetErrorString(uint32_t status, char *statusDesc) override;
    /**
     * 传动卡片到指定位置
     */
    int MoveCard(int postionMoveTo) override;
    /**
     * 翻转卡片
     */
    int FlipCard() override;
    /**
     * 将SDK结果码转为制卡机标准结果码
     */
    int TransformResultCode(std::string func, uint32_t libResult);

 private:
    bool isOpen;
    char usbPort[128];
};
}  // namespace Finance
}  // namespace SwanLink
#endif  // SWANLINK_FINANCE_MAKECARD_SERVICES_ADAPTOR_SEAORY_INCLUDE_SEAORY_ADAPTOR_H